home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / cmds / ggraph / ggraph.h < prev    next >
Text File  |  1992-05-05  |  3KB  |  162 lines

  1. /****************************************************************
  2.  *                                *
  3.  *    Definitons used in gremlin files            *
  4.  *                                *
  5.  *    Gremlin file format is:                    *
  6.  *    "gremlinfile"                        *
  7.  *    <orientation> <x> <y>                    *
  8.  *    <element>                        *
  9.  *    <element>                        *
  10.  *        .                            *
  11.  *        .                            *
  12.  *     -1                            *
  13.  *                                *
  14.  *    Each element has the following format            *
  15.  *    <type>                            *
  16.  *    <points>    i.e. X, Y coords            *
  17.  *    -1.0 -1.0    to mark end of figure            *
  18.  *    <brush> <size>                        *
  19.  *    <string length> <string>                *
  20.  *                                *
  21.  *    The screen origin is 0, 0 the size is 512, 480        *
  22.  *    116 is edge of menu in vertical mode (menu on left)    *
  23.  *    395 is edge of menu in horizontal mode (menu on top)    *
  24.  *                                *
  25.  ****************************************************************/
  26. /* some useful definitions */
  27. #define TRUE    1
  28. #define FALSE    0
  29. #define NULL    0
  30. #define ERROR    -1
  31. #define BLANK    ' '
  32. #define COMMENTCHAR ';'
  33. #define TAB '\t'
  34. #define NEWLINE '\n'
  35.  
  36. #define MAXLINES 400        /* max number of lines to plot */
  37. #define MAXSIZE    5000        /* max number of points to plot */
  38. #define MAXGRAPH 1        /* max number of graphs on a page */
  39.  
  40. /* device type things */
  41. #define XSCREENMAX 500.0
  42. #define YSCREENMAX 480.0
  43. #define XSCREENMIN 120.0
  44. #define YSCREENMIN 1.0
  45. #define XPLOTMAX 480.0        /* max plot area */
  46. #define YPLOTMAX 450.0
  47. #define XORIGIN 150
  48. #define YORIGIN 50
  49.  
  50. #define SQRT2 0.707107        /* sqrt(2) / 2.0 */
  51. #define TWOPI 6.283185
  52.  
  53. #define NFONTS 4
  54. #define NBRUSHES 6
  55. #define NSIZES 4
  56. #define NSTIPPLES 8
  57.  
  58. #define GR_ERROR -1
  59. #define GR_OK 0
  60.  
  61. #define SUN_GREMLIN 0
  62. #define AED_GREMLIN 1
  63.  
  64. /*----Brush definitions type line to draw----*/
  65.  
  66. #define BRUSH_INVISIBLE    0
  67. #define BRUSH_DOT    1
  68. #define BRUSH_ALT    2
  69. #define BRUSH_THICK    3
  70. #define BRUSH_DASH    4
  71. #define BRUSH_THIN    5
  72. #define BRUSH_NORMAL    6
  73.  
  74. /*----Font definitions----*/
  75.  
  76. #define ROMAN        1
  77. #define ITALICS        2
  78. #define BOLD        3
  79. #define SPECIAL        4
  80.  
  81. /*----Font Size----*/
  82.  
  83. #define SMALL        1
  84. #define MEDIUM        2
  85. #define LARGE        3
  86. #define EXLARGE        4
  87.  
  88. /*----Figure types----*/
  89.  
  90. #define BOTLEFT_TEXT    0
  91. #define BOTRIGHT_TEXT    1
  92. #define TEXT        2
  93. #define LINE        3
  94. #define CIRCLE        4
  95. #define CURVE        5
  96. #define POLYGON        6
  97. #define TOPLEFT_TEXT    10
  98. #define TOPCENTER_TEXT    11
  99. #define TOPRIGHT_TEXT    12
  100. #define CENTERLEFT_TEXT 13
  101. #define CENTERRIGHT_TEXT 14
  102. #define BOTCENTER_TEXT    15
  103. #define CENTERCENTER_TEXT 2
  104. /*----Orientations----*/
  105.  
  106. #define HORIZONTAL    0
  107. #define VERTICAL    1
  108.  
  109. /*----Header String----*/
  110.  
  111. #define FIRSTLINE    "gremlinfile"
  112. #define SFIRSTLINE    "sungremlinfile"
  113.  
  114. /*----Miscelaneous----*/
  115.  
  116. #define LASTPOINT    (-1.0)
  117.  
  118. #define ALLINES MAXLINES+1
  119.  
  120. /* point symbol types */
  121. #define NOSYMBOL 0
  122. #define BOX 1
  123. #define RING 2
  124. #define CROSS 3
  125. #define STAR 4
  126. #define TRIANGLE 5
  127. #define UTRIANGLE 6
  128. #define CROSSBOX 7
  129. #define STARBOX 8
  130. #define DIAMOND 9
  131. #define CROSSDIAMOND 10
  132.  
  133. /* Types of graphs */
  134. #define LINEAR 0
  135. #define HIST 1
  136. #define LOG 2
  137. #define PIE 3
  138. #define BAR 4
  139. /* frame for graph */
  140. #define FRAME1X XSCREENMIN
  141. #define FRAME2X XSCREENMIN
  142. #define FRAME3X XSCREENMAX
  143. #define FRAME4X XSCREENMAX
  144. #define FRAME1Y YSCREENMIN
  145. #define FRAME2Y YSCREENMAX
  146. #define FRAME3Y YSCREENMAX
  147. #define FRAME4Y YSCREENMIN
  148.  
  149. /* type of text */
  150. #define T_TITLE 0
  151. #define T_XLABEL 1
  152. #define T_YLABEL 2
  153. #define T_LEGEND 3
  154.  
  155. /* types of frames */
  156. #define G_FRAME 0        /* graph frame */
  157. #define L_FRAME 1        /* legend frame */
  158.  
  159. #define cg graph[curgraph]
  160. #define cl graph[curgraph].lines[curline]
  161.  
  162.